package com.itheima;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/servltDemo03")
public class ServltDemo03 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //设置格式
        resp.setContentType("text/html:charset=UTF-8");
        String sst = "您的用户名或密码有误，5秒后自动跳回登陆页面！";
        //写出数据
        resp.getWriter().write(sst);
        //设置刷新
        resp.setHeader("Refresh","5;URL=/aaa/BiaoDan.html");
    }
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req, resp);
    }
}
